5242b2cc6bebaa6dbe364e6d63c4a42942aa342f,esc-commands/src/main/java/org/cloudifysource/esc/shell/commands/BootstrapCloud.java,BootstrapCloud,copySecurityFiles,#String#,328

Before Change


			//copy to the overrides folder, to be copied to all management servers as well
			File securityTargetFile = new File(providerDirectory,  OVERRIDES_FOLDER + PATH_SEPARATOR
					+ "spring-security.xml");
			FileUtils.copyFile(securitySourceFile, securityTargetFile);
		} else {
			//TODO : should we use the default security location and assume it was edited by the user?
			//securityFilePath = CLOUDIFY_HOME + "/config/security/spring-security.xml";

After Change


			//copy to the overrides folder, to be copied to all management servers as well
			File defaultSecurityFile = new File(providerDirectory + PATH_SEPARATOR + DEFAULT_SECURITY_FILE_PATH);
			File backupSecurityFile = new File(providerDirectory + PATH_SEPARATOR + BACKUP_SECURITY_FILE_PATH);
			if (!(securitySourceFile.getCanonicalFile().equals(defaultSecurityFile.getCanonicalFile()))) {
				if (defaultSecurityFile.exists()) {
					// create a backup of the existing security configuration file
					FileUtils.copyFile(defaultSecurityFile, backupSecurityFile);
				}
				
				//overrides if exists
				this.securityFileCopied = true;
				FileUtils.copyFile(securitySourceFile, defaultSecurityFile);
			}
		} else {
			//TODO : should we use the default security location and assume it was edited by the user?